package org.kgc.alanhealth.service.impl;

import org.kgc.alanhealth.entity.HospitalComments;

import org.kgc.alanhealth.mapper.HospitalCommentsMapper;
import org.kgc.alanhealth.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CommentsServiceImpl implements CommentsService {
    @Autowired
    HospitalCommentsMapper hospitalCommentsMapper;
    @Override
    public List<HospitalComments> getHospitalComments() {
        return hospitalCommentsMapper.getAllComments();
    }

    @Override
    public int insertAll( HospitalComments comments) {
        // 设置插入的默认值或处理逻辑
        comments.setReleasedate(new Date());
        comments.setReplydate(new Date());
        return hospitalCommentsMapper.insertAll(comments);
    }

    @Override
    public List<HospitalComments> selectByPrimaryKey(Long id) {
        return hospitalCommentsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<HospitalComments> selectAll(int id) {
        return hospitalCommentsMapper.selectAll(id);
    }

    @Override
    public List<HospitalComments> getAllByReply() {
        return hospitalCommentsMapper.getAllByReply();
    }

    @Override
    public List<HospitalComments> getAllByRelease() {
        return hospitalCommentsMapper.getAllByRelease();
    }

}
